import {del, get,post, put} from '../../../utils/request'
import { AddParams, AddResult, ListParams, ListResult } from './type'

export const getQuestionList=(data:ListParams)=>{
  return get<ListParams,ListResult>('/api/question/list',data)
}

//添加
export const addQuestion=(data:AddParams)=>{
  return post<AddParams,AddResult>('/api/question/add',data)
}

//获取单条
export const getQuestionModel=(id:number)=>{
  return get<number,AddResult>(`/api/question/get/${id}`)
}
//修改
export const updateQuestion=(data:AddParams)=>{
  return put<AddParams,AddResult>('/api/question/update',data)
}

//删除
export const delQuestion=(id:number)=>{
  return del<number,null>(`/api/question/delete/${id}`)
}

//批量删除
export const delMany=(ids:number[])=>{
  return post<number[],null>('/api/question/deleteAll',ids)
}